Skip to content

Show how to find the credentials your data uses that the vocabulary lacks - #1515

Merged
derek73 merged 4 commits into
masterfrom
docs/finding-missing-credentials
Nov 21, 2026
Merged

derek73 merged 4 commits into
masterfrom
docs/finding-missing-credentials

Conversation

@derek73

@derek73 derek73 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

A docs-only recipe for finding the credentials a caller's data uses that the vocabulary does not list.

Where it goes and why

It goes in docs/policy.rst, as a subsection "Finding the credentials your data uses" at the end of "Credentials the vocabulary doesn't list" (:ref: label finding-missing-credentials). That section is where a reader lands after finding a credential read as a given name: it explains the two shapes the parser already reads a credential by (dotted, all caps), and this recipe covers what neither shape reaches. Neither shapes.rst nor usage.rst holds a credentials section. Adding words itself stays in customize.rst's "Adding a word", which the recipe links.

The recipe

A numbered list of four steps, then a doctest on invented names:

  1. Parse every name, and keep those whose text holds a comma and whose family came out two or more words long.
  2. Count the given names of those kept.
  3. Read the count from the top; the credentials stand near it, among real listings of a two-word surname, which in data rich in two-word surnames can outnumber them.
  4. Add each with Lexicon.add(word, kind="credential") and build a Parser on that lexicon.

The section says that the count finds the comma shape, and that an added word is read as a credential after a comma and where it ends a name with no comma (Ana Ruiz Paz PhDc), not earlier in the name. A second doctest shows that a suffix-or-name report marks a credential weighed against a name (Ana Ruiz Paz, XYZ, and an unlisted word behind a listed credential, Ana Ruiz Paz, PhD PhDc), while a mixed-case word opening the part after the comma carries none (Ana Ruiz Paz, PhDc). The new label is linked from the section's intro and from customize.rst's "Adding a word".

The example words are PhDc and Pharm-D. Both are mixed-case credentials that the mixed-case credential shape under measurement would still not read (a capital only inside the word; a hyphenated word), so the example stays true if that shape lands.

Checks

  • uv run sphinx-build -q -b doctest docs <tmp>: 0 failures. -b html: no output.
  • The recipe's code, run as a script with -W error, prints what the doctest shows. It type-checks under the project's mypy config (Counter[str] annotated, as a reader under mypy would write it).
  • uv run python tools/docs_scan.py policy.rst: nothing in the new section; the one finding is an older paragraph at line 534.
  • No release-log bullet, as docs/AGENTS.md asks none for a docs change.

Reviews

  • pr-review-toolkit:comment-analyzer, as a reader of the new section: six findings, all applied in 9a5a452d:
    • the no-report claim was too wide: a word behind a listed credential is reported;
    • the reach of an added word was unstated;
    • "the top of the count" was overstated for data rich in two-word surnames;
    • the label had no link;
    • the block relied on imports made higher up the page;
    • two variable names were generic.
  • pr-review-toolkit:comment-analyzer, a review of that fix commit: one claim too wide ("wherever it stands": an added word is a credential only after a comma or ending the name), fixed in 45936e85; its two wording nits taken in 45936e85 and 650978f8.

🤖 Generated with Claude Code

…lary lacks

A subsection of policy.rst's 'Credentials the vocabulary doesn't list': parse, keep comma names whose family came out two or more words long, count their given names, and add the credentials at the top with Lexicon.add(kind='credential'). It also says that a suffix-or-name report marks a credential weighed against a name, and that an unlisted mixed-case word carries none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 21, 2026
@derek73 derek73 added docs Documentation fixes and updates suffixes Generational suffixes and credentials (rules/S) labels Nov 21, 2026
@derek73 derek73 self-assigned this Nov 21, 2026
derek73 and others added 3 commits November 21, 2026 12:44
Scope the no-report claim to a word standing alone after the comma (a word behind a listed credential is read and reported); say an added word is read wherever it stands, with a doctest line; soften 'the top of the count' for data rich in two-word surnames; import what the block uses; rename its loop variables; link the new label from the section's intro and from customize.rst's Adding a word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 1e920d6 into master Nov 21, 2026
14 checks passed
@derek73
derek73 deleted the docs/finding-missing-credentials branch November 21, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation fixes and updates suffixes Generational suffixes and credentials (rules/S)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant